package com.yaorange.nongjt.certificate.controller.wxapi;

import com.yaorange.nongjt.certificate.domain.NjtArea;
import com.yaorange.nongjt.certificate.service.INjtAreaService;
import com.yaorange.nongjt.common.core.domain.AjaxResult;
import com.yaorange.nongjt.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author coach tam
 * @email 327395128@qq.com
 * @values 坚持灵活 灵活坚持
 * @since 2024/10/16
 */
@RestController
@RequestMapping("/api/area")
public class NjtAreaAPI {

    @Autowired
    private INjtAreaService areaService;
    @GetMapping("/queryListRoot")
    public AjaxResult queryListRoot(){
        List<List<NjtArea>> result = areaService.selectDefaultList();
        return AjaxResult.success(result);
    }

    @GetMapping(value = "/queryChildrenByParentCode")
    public AjaxResult queryChildrenByParentCode(@RequestParam("parentCode")String code)
    {
        return AjaxResult.success(areaService.selectListByParentCode(code));
    }
}
